<template>
    <div>
        <router-view/>
    </div>

</template>
<script setup>
    import {onBeforeMount,} from 'vue'
    import { ElMessage } from 'element-plus'
    import {useRouter} from 'vue-router';
    const router = useRouter();
    onBeforeMount(() => {
        if (localStorage.getItem("user") == null){
            ElMessage({
                showClose: true,
                message: '请先登录',
                type: 'error',
            })
                    router.push("/login")
              }
    })
</script>
<style>

</style>
